<template>
  <div id="app">
    <input type="text" v-model="username">
    <button @click="clickFn">click</button>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name: 'App',
    data(){
      return {
        username:""
      }
    },
    methods:{
      async clickFn(){
        //发送请求将页面上表单数据入库
        const data = await axios.post("/user/addUser",{name:this.username},{
          baseURL:"http://localhost:8888"
        })
        console.log(data);
      }
    }
  }
</script>

<style scoped>

</style>
